package temp;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class CsvRowCountMapper extends Mapper<LongWritable, Text, NullWritable, LongWritable> {
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        // 每读取一行，输出一个计数（1L 是 LongWritable 类型）
        context.write(NullWritable.get(), new LongWritable(1L)); // 关键：输出 LongWritable
    }
}